<%--
  Created by IntelliJ IDEA.
  User: 86150
  Date: 2021/7/14
  Time: 16:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>编码规则查询</title>
    <!-- CSS -->
    <link rel="stylesheet" href="${mybasePath}assets/bootstrap/css/bootstrap.min.css">
    <jsp:include page="../include/headtag.jsp" />
    <!-- <link rel="stylesheet"
        href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500"> -->
    <link rel="stylesheet"
          href="assets/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/form-elements.css">
    <link rel="stylesheet" href="assets/css/style.css">
</head>
<body>

<!--------------------------------基础架构------------------------------------->

<jsp:include page="../include/head.jsp" />
<jsp:include page="../include/menu.jsp" />
<div id="page-wrapper" style="margin-top: 50px;">
    <div id="page-inner">
        <div class="row">
            <div class="col-md-12">
                <div class="text-left">
                    <a href="/index">首页</a>&nbsp;&gt;&nbsp;<a href="/codeSearchIndex" class="acts CurrChnlCls">编码查询</a> &gt; <a href="/ruleSearch" class="acts CurrChnlCls">编码规则查询</a>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <h3 class="text-left">功能列表</h3>
                <div class="col-md-12">
                    <div class="nav navbar-nav navbar-right">
                        <a href="">查看全部功能</a>
                    </div>
                </div>
            </div>
        </div>
        <hr />
        <br />
 <!--------------------------------编码规则查询筛选条件框------------------------------------->

        <div class="container-fluid">
            <form  action="/inputKey2" class="col-sm-12 select-info table-bordered" method="post">
                <table class="table-bordered">
                    <br />
                    <tr>
                        <div class="row">
                            <div class="form-horizontal">
                                <div class="col-md-2">
                                    <label for="rulecategorys">规则库选择</label>
                                </div>
                                <div class="col-md-2">
                                    <select id="rulecategorys" class="form-control" role="select" value="${rulecategorys_result}"name="rulecategorys">
                                        <option value="0" placeholder="请选择"></option>
                                        <option value="1">动物</option>
                                        <option value="2">房间</option>
                                        <option value="3">表单</option>
                                        <option value="4">项目</option>
                                        <option value="5">人事</option>
                                        <option value="6">实验</option>
                                        <option value="7">设备</option>
                                        <option value="8">样本</option>
                                        <option value="9">工作流</option>
                                    </select>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-4">
                                    <input id="rule_string" class="form-control" name="rule_string" value="${rule_string_result}" placeholder="请填写您要搜索的编码规则名称">
                                </div>
                                <div class="col-md-1">
                                    <button  type="submit" onclick="isExistt()" name="sou">搜索</button>
                                </div>
                                <div class="col-md-1" >
                                    <button type=“button” onclick="rep()" name="sous" >重置</button>
                                </div>
                            </div>
                        </div>
                    </tr>
                    <br />
                </table>
            </form>

        </div>
<!--------------------------------编码规则数据库列表显示------------------------------------->
        <div class="container-fluid">
            <form  class="col-sm-12 select-info table-bordered" method="post">
                <table class="table table-striped table-hover text-left">
                    <thead>
                    <tr>
                        <th style="text-align: center;">规则编号</th>
                        <th style="text-align: center;">规则名称</th>
                        <th style="text-align: center;">码节点数量</th>
                        <th style="text-align: center;">规则可用状态</th>
                        <th style="text-align: center;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="coderule" items="${coderuleresult}" varStatus="s">
                        <tr>
                            <td style="text-align: center;">${coderule.codeRuleId }</td>
                            <td style="text-align: center;">${coderule.codeRuleName }</td>
                            <td style="text-align: center;">${coderule.codeCodeCount }</td>
                            <td style="text-align: center;">${coderule.codeState}</td>
                            <td style="text-align: center;">
                                        <a onclick="redir_to_top(${coderule.codeRuleId})" class="btn btn-primary btn-sm">查看详细规则</a>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </form>

        </div>

    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->


</body>
<!-- Javascript -->
<script src="${mybasePath}assets/bootstrap/js/bootstrap.min.js"></script>
<script src="${mybasePath}assets/bootstrap/js/jquery.min.js"></script>
<script src="${mybasePath}assets/js/jquery.backstretch.min.js"></script>
<script src="${mybasePath}assets/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript">
    function redir_to_top(id) {
        window.location.href = "/ruleSearchApply?id="+id;
    }
    function isExistt() {
        var titleVal2 = rulecategorys.value;
        var titleVal1 = $("input[name=rule_string]").val();
        if(titleVal1=="" &&titleVal2==0)
        {
            alert("查询标识为空，请输入！");
            return false;
        }
    }
    function rep() {
        window.location.href ="/ruleSearch";
    }

    $(document).ready(function (){
        var errorString="${error}";
        if(errorString!="")
        {
            alert(errorString);
        }
    })
</script>
</html>
